<?php
	
	class MysqlConfig
	{
		const DBHOST = "localhost";
		const DBUSER = "root";
		const DBPASSWORD = "";
		const DBNAME = "bildprojects";
		
		private static $dbconnection = null;
		
		// Konekcija sa MySQL Bazom Podataka, preko PDO
		public static function getConnection(){
			try{
				if(self::$dbconnection == null){
					$dns = "mysql:host=" . self::DBHOST .";dbname=" . self::DBNAME;
					self::$dbconnection = new PDO($dns, self::DBUSER, self::DBPASSWORD, array(PDO::ATTR_PERSISTENT => true));
				}
				return self::$dbconnection;
				
			}catch(PDOException $e){
				return $e->getMessage();
			}
		}
		
	}
	
?>